<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>View All Flights</title>
<link href="../css/styles.css" rel="stylesheet" type="text/css"></link>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>

<script src="../js/jquery-latest.js"> </script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>

<script type="text/javascript">

function viewAllPassengers(flightId,journeyDate){
	
	window.open("GetPassengers.do?flightId="+flightId+"&journeyDate="+journeyDate, "passengers", 'height=600,width=900');
	
}
function viewAllReservations(cunfirmationNumber){

window.open("viewAllReservations.do?cunfirmationNumber="+cunfirmationNumber,"Reservations",'height=600,width=900');
	
}

</script>

</head>
<body>


<form name="allJourney" id="allJourney">
<div id="divAllFlights">
<table style="COLOR: #004040; FONT-WEIGHT: bold; FONT-SIZE: x-small; FONT-FAMILY: 'Verdana'; vertical-align: top; 
border-bottom-style:solid; ; border-bottom-color: gray; border-right-style:solid; ; border-right-color: gray; border-left-style:solid; ;
 border-left-color: gray; border-top-style:solid; ; border-top-color: gray" >
 <thead style="BACKGROUND-COLOR: #fbfe70;">
			<tr>
			<td colspan="11" align="center"><c:out value="${param.destination}"></c:out>-<c:out  value="${param.origin}"></c:out>
			</td>
		</tr>
			<tr>
				<td>Flight Id</td>
				<td>Flight Number</td>
				<td>Airline</td>
				<td>Source</td>
				<td >Intermediate</td>
				<td >Destination</td>
				<td>Number of Seats</td>
				<td >Flight Time</td>
				<td >Flight Price</td>
				<td>EDIT</td>	
			</tr>
		</thead>
		
		
		<c:if test="${not empty lstAllJourneyDetails}">
			<c:set var="i" value="1"/>
			<c:forEach items="${lstAllJourneyDetails}" var="item">
			<c:if test="${i % 2 == 0}">
				<c:set value="BACKGROUND-COLOR: #d6d6d6;" var="style"></c:set>
			</c:if>
			<tr style="${style}">
				<c:set value="" var="style"></c:set>
				<td><c:out value="${item.flight.flightId}" /></td>
				<td><c:out value="${item.flight.flightNumber}" /></td>
				<td><c:out value="${item.flight.airlineName}" /></td>
				<td><c:out value="${item.flight.source}"></c:out></td>
				<td><c:out value="${item.flight.intermediate}" /></td>
				<td><c:out value="${item.flight.destination}" /></td>
				<td><c:out value="${item.flight.numSeats}" /></td>
				<td><c:out value="${item.flight.timeOfFlight}" /></td>
				<td><c:out value="${item.flight.ticketPrice}"></c:out></td>
				
				<td><c:out value="${item.confirmationNumber}" /></td>
				<td></td>
				<td><a href="javascript:viewAllPassengers(<c:out value="${item.flight.flightId}"></c:out>,'<c:out value="${item.dateOfJourney}"></c:out>')">All Passengers In This Flight.</a></td>	
				<td><a href="javascript:viewAllReservations(<c:out value="${item.confirmationNumber}"></c:out>)">All Reservations By You.</a></td>	
				<c:set var="i" value="${i+1}"/>
			</tr>
			</c:forEach>
		</c:if>
 
 
</table>
</div>
</form>
</body>
</html>